package chinese.admin.dao;

import java.util.List;

import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.SQL;
import net.paoding.rose.jade.annotation.SQLParam;
import net.paoding.rose.jade.annotation.ReturnGeneratedKeys;

import chinese.admin.domain.ChnUser;
/**
 * <p>数据访问类</p>
 * <p>Table: ChnUser</p>
 *
 */
 @DAO
public interface ChnUserDAO {

	@SQL("SELECT * FROM ChnUser WHERE deleteFlag=1 LIMIT :t.start,:t.length")
	List<ChnUser> query(@SQLParam("t")ChnUser obj);

	@ReturnGeneratedKeys
	@SQL("INSERT INTO ChnUser(code,openId,nickName,image,sex,country,province,city,subscribeAt,deleteFlag,createAt,createUser,updateAt,updateUser) VALUES(:t.code,:t.openId,:t.nickName,:t.image,:t.sex,:t.country,:t.province,:t.city,:t.subscribeAt,:t.deleteFlag,:t.createAt,:t.createUser,:t.updateAt,:t.updateUser)")
	int create(@SQLParam("t")ChnUser obj);
	
	@SQL("UPDATE ChnUser SET code=:t.code,openId=:t.openId,nickName=:t.nickName,image=:t.image,sex=:t.sex,country=:t.country,province=:t.province,city=:t.city,subscribeAt=:t.subscribeAt,deleteFlag=:t.deleteFlag,createAt=:t.createAt,createUser=:t.createUser,updateAt=:t.updateAt,updateUser=:t.updateUser WHERE id=:t.id")
	void update(@SQLParam("t")ChnUser obj);
	
	@SQL("UPDATE ChnUser SET deleteFlag=1 WHERE id=:1")
	void delete(int id);

}